package org.wwb.antbox.user.model.user.view;

import org.ant.commons.commons.bean.BeanTool;
import org.ant.commons.models.view.AbstractBaseView;
import org.ant.model.common.session.SessionUser;
import org.wwb.antbox.user.model.user.entity.SysUser;

import java.util.Date;
import java.util.Set;

/**
 * @Author Bond
 * @Date: 2020/1/1 11:48
 * @Description: 用户相关信息View
 */
public class UserInfoView extends AbstractBaseView {

    /** 主键, 数据库字段：id */
    private String id;

    /** 登录账号, 数据库字段：login_name */
    private String loginName;

    /** 昵称, 数据库字段：nick_name */
    private String nickName;

    /** 真实姓名, 数据库字段：real_name */
    private String realName;

    /** 出生日期, 数据库字段：birthday */
    private Date birthday;

    /** 身份证号, 数据库字段：id_card */
    private String idCard;

    /** 性别, 数据库字段：sex */
    private String sex;

    /** 手机号, 数据库字段：mobile */
    private String mobile;

    /** 邮箱, 数据库字段：email */
    private String email;

    /** 头像地址, 数据库字段：avatar_url */
    private String avatarUrl;

    /** 星座, 数据库字段：constellation */
    private String constellation;

    /** 民族, 数据库字段：nation */
    private String nation;

    /** 省地区, 数据库字段：region */
    private String region;

    /** 市, 数据库字段：city */
    private String city;

    /** 详细地址, 数据库字段：address */
    private String address;

    /** 状态 正常、停用、冻结, 数据库字段：status */
    private String status;

    /** 动态秘钥, 数据库字段：authentication_key */
    private String authenticationKey;

    /** 最后活跃时间, 数据库字段：last_active_time */
    private Date lastActiveTime;

    /** 累计在线时长, 数据库字段：total_online_time */
    private Long totalOnlineTime;

    /** 备注, 数据库字段：remark */
    private String remark;

    /**
     * 登录时间
     */
    private Date loginTime;

    /**
     * 当前Token
     */
    private String token;

    /**
     * 用户角色集合
     */
    private Set<String> roleNames;

    /**
     * 用户权限集合
     */
    private Set<String> permissions;



    public static UserInfoView getUserInfoView(SysUser sysUser){
        UserInfoView userInfoView = new UserInfoView();
        BeanTool.copyProperties(sysUser,userInfoView);
        return userInfoView;
    }

    public static UserInfoView getUserInfoView(SessionUser sessionUser){
        UserInfoView userInfoView = new UserInfoView();
        BeanTool.copyProperties(sessionUser,userInfoView);
        return userInfoView;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getConstellation() {
        return constellation;
    }

    public void setConstellation(String constellation) {
        this.constellation = constellation;
    }

    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getAuthenticationKey() {
        return authenticationKey;
    }

    public void setAuthenticationKey(String authenticationKey) {
        this.authenticationKey = authenticationKey;
    }

    public Date getLastActiveTime() {
        return lastActiveTime;
    }

    public void setLastActiveTime(Date lastActiveTime) {
        this.lastActiveTime = lastActiveTime;
    }

    public Long getTotalOnlineTime() {
        return totalOnlineTime;
    }

    public void setTotalOnlineTime(Long totalOnlineTime) {
        this.totalOnlineTime = totalOnlineTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Set<String> getRoleNames() {
        return roleNames;
    }

    public void setRoleNames(Set<String> roleNames) {
        this.roleNames = roleNames;
    }

    public Set<String> getPermissions() {
        return permissions;
    }

    public void setPermissions(Set<String> permissions) {
        this.permissions = permissions;
    }
}
